-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[consensus] Add proposer role #3814
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3814 +/- ##
==========================================
+ Coverage 74.47% 75.37% +0.89%
==========================================
Files 269 303 +34
Lines 23925 25933 +2008
==========================================
+ Hits 17818 19546 +1728
- Misses 5174 5363 +189
- Partials 933 1024 +91
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: proposer
consensus/consensus.go
Outdated
} | ||
return addrs, nil | ||
} | ||
// TODO implement proposorsByEpochFunc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a TODO
@@ -177,6 +183,12 @@ func (c *roundCalculator) Delegates(height uint64) ([]string, error) { | |||
return c.delegatesByEpochFunc(epochNum) | |||
} | |||
|
|||
// Delegates returns list of proposors at given height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Proposers returns a list of candidate proposers at given height
@@ -408,11 +408,13 @@ func (m *ConsensusFSM) prepare(evt fsm.Event) (fsm.State, error) { | |||
} | |||
|
|||
overtime := m.ctx.WaitUntilRoundStart() | |||
if proposal != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed? since delegates only receive proposal, don't need to broadcast proposal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or as phase 1, ENode and CNode still use the same dpos code?
if that's the plan, need to add the IsENode()
in the consensus/dpos module? since lots of code/funcs will only used by CNode
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
Description
In order to implement execution node, firstly the block proposor is no longer choosen from delegates but from a new group named proposors in each round. The main changes are:
Currently, the delegates and proposors should be the same list so that the actual consensus process could be consistent with past.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: